﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KPWeb.Data;

namespace KPWeb.Kontrolki
{
    public partial class News : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {


            if (!this.IsPostBack)
            {
                //if (this.Request["countNewsK"] != null)
                //{
                //    int cNews = int.Parse(Request["countNewsK"].ToString());
                //    RefreshView(cNews, 0);
                //}
                //else
                //{
                //    RefreshView(3, 0);
                //}
           
            }

        }


        public void RefreshView(int count,int jednostkaGlownaID)
        {

            //this.ltlContent.Text = "";
            //if (count > 0)
            //{
            //    foreach (Wiadomosci item in Model.NewsGetCount(count, jednostkaGlownaID))
            //    {
            //        this.ltlContent.Text += "<div class='news'>" + " <font color='green'> <b>" + String.Format("{0:yyyy-MM-dd}", item.DateWhen) +
            //            "</b> </font>" + "&nbsp" + item.HTMLMessage + "</div>";
            //    }
            //}
            //else 
            //{
            //     foreach (Wiadomosci item in Model.NewsGetAll(jednostkaGlownaID))
            //    {
            //        this.ltlContent.Text += "<div class='news'>" + " <font color='green'> <b>" + String.Format("{0:yyyy-MM-dd}", item.DateWhen) +
            //            "</b> </font>" + "&nbsp" + item.HTMLMessage + "</div>";
            //    }
            //}

        }
        public void ClearView()
        {
          

        }




    }
}